package com.zhz.config;

import com.zhz.geetest.GeetestLib;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author ：zhz
 * @date ：Created in 2021/01/02
 * @version: V1.0
 * @slogan: 天下风云出我辈，一入代码岁月催
 * @description: 极验验证的自动配置
 **/
@Configuration
@EnableConfigurationProperties(GeetestProperties.class)
public class GeetestAutoConfiguration {

    private GeetestProperties geetestProperties ;
    public GeetestAutoConfiguration(GeetestProperties geetestProperties){
        this.geetestProperties = geetestProperties ;
    }
    @Bean
    public GeetestLib geetestLib(){
        GeetestLib geetestLib = new GeetestLib(geetestProperties.getGeetestId(),
                geetestProperties.getGeetestKey());
        return geetestLib ;
    }
}
